import type { IOneService, IServiceData } from '@/types/service'
import type { IPage } from '@/types/table'
import { request } from '@/utils/request'

/**
 * 获取报修申请列表
 * @param data 
 * @returns 
 */
export const getServicesList = (data: IPage) =>
    request<IServiceData>('/campusServices','get',data)

/**
 * 审核服务帖子-通过
 * @param id 
 * @returns 
 */
export const isPassedForService = (id:number) => 
    request<string>('/campusServices/isPassed/'+id,'patch')

/**
 * 审核服务帖子-违规
 * @param id 
 * @returns 
 */
export const notPassedForService = (id:number) => 
    request<string>('/campusServices/notPass/'+id,'patch')

/**
 * 获取服务帖子内容详情
 * @param id 
 * @returns 
 */
export const getOneServices =  (id:number) => 
    request<IOneService>('/campusServices/'+id,'get')